package com.flyiu.data.consistency.registry;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

import org.springframework.util.Assert;

import com.flyiu.data.consistency.bean.PartnerMetaDataProcessor.PartnerMetaData;

public class PartnerMeteDateRegistry {
	private static Map<String, PartnerMetaData> partnerMetaDataMap = new ConcurrentHashMap<>();

	public static void regist(String name, PartnerMetaData meteData) {
		Assert.isNull(getPartnerMeteData(name), name + "重复初始化 repeat init method");
		partnerMetaDataMap.put(name, meteData);
	}

	public static PartnerMetaData getPartnerMeteData(String name) {
		return partnerMetaDataMap.get(name);
	}
}
